package tech.threekilogram.activitytasktest;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

/**
 * @author liujin
 */
public class ClearTopActivity extends AppCompatActivity {

      public static void start ( Context context ) {

            Intent starter = new Intent( context, ClearTopActivity.class );
            context.startActivity( starter );
      }

      @Override
      protected void onCreate ( Bundle savedInstanceState ) {

            super.onCreate( savedInstanceState );
            setContentView( R.layout.activity_clear_top );
      }

      public void toMain ( View view ) {

            Intent intent = new Intent( this, MainActivity.class );
            intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
            startActivity( intent );
      }
}
